package com.ilioili.waterfall;


import android.view.View;

public class Item {
	View v;
	Item upItem;
	Item downItem;
	int index;
	int top;
	int left;
	int right;
	int bottom;
	/**
	 * 是否可见（超出可视边�?000个像素认为不可见，否则认为可见）
	 * @param scrollPosition
	 * @param parentHeight
	 * @return
	 */
	boolean isVisible(int scrollPosition,int parentHeight, int offset){
		if(scrollPosition<=bottom+offset && scrollPosition+parentHeight+offset>=top){
			return true;
		}else{
			return false;
		}
	}
	final void reset() {
		left = 0;
		bottom = 0;
		right = 0;
		bottom = 0;
		upItem = null;
		downItem = null;
		v = null;
		index = 0;
	}
	@Override
	public String toString() {
		return "top:"+top+"&bottom:"+bottom;
	}
	
}
